<?php if(!defined("HDPHP_PATH"))exit;C("SHOW_NOTICE",FALSE);?><!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>角色权限设置</title>
	<link type="text/css" rel="stylesheet" href="http://localhost/gks/1113/shop/HSHOP/Admin/View/Access/css/set.css"/>
	<script type='text/javascript' src='http://localhost/gks/1113/hdphp/hdphp/Extend/Org/Jquery/jquery-1.8.2.min.js'></script>
<link href='http://localhost/gks/1113/hdphp/hdphp/Extend/Org/hdjs/hdui/css/hdui.css' rel='stylesheet' media='screen'>
<script src='http://localhost/gks/1113/hdphp/hdphp/Extend/Org/hdjs/hdui/js/hdui.js'></script>
<link href='http://localhost/gks/1113/hdphp/hdphp/Extend/Org/hdjs/hdvalidate/css/hdvalidate.css' rel='stylesheet' media='screen'>
<script src='http://localhost/gks/1113/hdphp/hdphp/Extend/Org/hdjs/hdvalidate/js/hdvalidate.js'></script>
<script src='http://localhost/gks/1113/hdphp/hdphp/Extend/Org/cal/lhgcalendar.min.js'></script>
<script src='http://localhost/gks/1113/hdphp/hdphp/Extend/Org/hdjs/hdslide/js/hdslide.js'></script>
<script type='text/javascript'>
HOST = 'http://localhost';
ROOT = 'http://localhost/gks/1113/shop';
WEB = 'http://localhost/gks/1113/shop/index.php';
URL = 'http://localhost/gks/1113/shop/index.php/Admin/Access/set/rid/1';
APP = 'http://localhost/gks/1113/shop/HSHOP';
COMMON = 'http://localhost/gks/1113/shop/HSHOP/Common';
HDPHP = 'http://localhost/gks/1113/hdphp/hdphp';
HDPHPDATA = 'http://localhost/gks/1113/hdphp/hdphp/Data';
HDPHPEXTEND = 'http://localhost/gks/1113/hdphp/hdphp/Extend';
MODULE = 'http://localhost/gks/1113/shop/index.php/Admin';
CONTROLLER = 'http://localhost/gks/1113/shop/index.php/Admin/Access';
ACTION = 'http://localhost/gks/1113/shop/index.php/Admin/Access/set';
STATIC = 'http://localhost/gks/1113/shop/Static';
HDPHPTPL = 'http://localhost/gks/1113/hdphp/hdphp/Lib/Tpl';
VIEW = 'http://localhost/gks/1113/shop/HSHOP/Admin/View';
PUBLIC = 'http://localhost/gks/1113/shop/HSHOP/Admin/View/Public';
CONTROLLERVIEW = 'http://localhost/gks/1113/shop/HSHOP/Admin/View/Access';
HISTORY = 'http://localhost/gks/1113/shop/index.php/Admin/Role/index';
</script>
</head>
<body>
	<div class="wrap hd-form">
		<div class="menu_list">
			<ul>
				<li><a href="<?php echo U('Role/index');?>">角色列表</a></li>
				<li><a href="<?php echo U('Role/add');?>">添加角色</a></li>
				<li><a href="<?php echo U('Role/edit',array('rid'=>$hd.get.rid));?>">编辑角色</a></li>
			</ul>
		</div>
		<div class="title-header">角色权限设置</div>
		<form action="" method="post">
			<input type="hidden" name='rid' value="<?php echo $_GET['rid'];?>">
			<table class="table1">
				<thead>
					<?php $hd["list"]["n"]["total"]=0;if(isset($node) && !empty($node)):$_id_n=0;$_index_n=0;$lastn=min(1000,count($node));
$hd["list"]["n"]["first"]=true;
$hd["list"]["n"]["last"]=false;
$_total_n=ceil($lastn/1);$hd["list"]["n"]["total"]=$_total_n;
$_data_n = array_slice($node,0,$lastn);
if(count($_data_n)==0):echo "";
else:
foreach($_data_n as $key=>$n):
if(($_id_n)%1==0):$_id_n++;else:$_id_n++;continue;endif;
$hd["list"]["n"]["index"]=++$_index_n;
if($_index_n>=$_total_n):$hd["list"]["n"]["last"]=true;endif;?>

						<?php $hd["list"]["m"]["total"]=0;if(isset($n['_data']) && !empty($n['_data'])):$_id_m=0;$_index_m=0;$lastm=min(1000,count($n['_data']));
$hd["list"]["m"]["first"]=true;
$hd["list"]["m"]["last"]=false;
$_total_m=ceil($lastm/1);$hd["list"]["m"]["total"]=$_total_m;
$_data_m = array_slice($n['_data'],0,$lastm);
if(count($_data_m)==0):echo "";
else:
foreach($_data_m as $key=>$m):
if(($_id_m)%1==0):$_id_m++;else:$_id_m++;continue;endif;
$hd["list"]["m"]["index"]=++$_index_m;
if($_index_m>=$_total_m):$hd["list"]["m"]["last"]=true;endif;?>

							<tr>
								<td>
									<p class="p"><label><input type="checkbox"  <?php if(in_array($m['name'],$controller)){?>checked=""<?php }?>> <?php echo $m['title'];?></label></p>
									<ul>
										<?php $hd["list"]["d"]["total"]=0;if(isset($m['_data']) && !empty($m['_data'])):$_id_d=0;$_index_d=0;$lastd=min(1000,count($m['_data']));
$hd["list"]["d"]["first"]=true;
$hd["list"]["d"]["last"]=false;
$_total_d=ceil($lastd/1);$hd["list"]["d"]["total"]=$_total_d;
$_data_d = array_slice($m['_data'],0,$lastd);
if(count($_data_d)==0):echo "";
else:
foreach($_data_d as $key=>$d):
if(($_id_d)%1==0):$_id_d++;else:$_id_d++;continue;endif;
$hd["list"]["d"]["index"]=++$_index_d;
if($_index_d>=$_total_d):$hd["list"]["d"]["last"]=true;endif;?>

											<li>
												<label><input type="checkbox" name="access[<?php echo $m['name'];?>][]" value="<?php echo $d['name'];?>" <?php if(in_array($d['name'],$action[$m['name']])){?>checked=""<?php }?>> <?php echo $d['title'];?></label>
											</li>
										<?php $hd["list"]["n"]["first"]=false;
endforeach;
endif;
else:
echo "";
endif;?>
									</ul>
								</td>
							</tr>
						<?php $hd["list"]["m"]["first"]=false;
endforeach;
endif;
else:
echo "";
endif;?>
					<?php $hd["list"]["d"]["first"]=false;
endforeach;
endif;
else:
echo "";
endif;?>
				</thead>
				</tr>
			</table>
			<br/>
			<input type="submit" value="提交设置" class="hd-success"/>
		</form>
	</div>
	<script type="text/javascript" src="http://localhost/gks/1113/shop/HSHOP/Admin/View/Access/js/js.js"></script>
</body>
</html>